<%-- 
    Document   : Login
    Created on : Jun 20, 2013, 11:48:46 PM
    Author     : quannq
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<style>
    .errorblock {
        color: #ff0000;
        background-color: #ffEEEE;
        border: 3px solid #ff0000;
        padding: 8px;
        margin: 16px;
    }
</style>
<div style="width: 100%;" align="center">

    <h1>This is Login Page!</h1>
    <c:if test="${not empty error}">
        <div class="errorblock">
            Your login attempt was not successful, try again.<br /> Caused :
            ${sessionScope["SPRING_SECURITY_LAST_EXCEPTION"].message}
        </div>
    </c:if>
    <c:if test="${not empty active}">
        <h1 style="color: green">Tài Khoản Được Kích Hoạt</h1>
        <h1 style="color: green">Bạn có thể đănh nhập</h1>
    </c:if>
        <c:if test="${not empty logon}">
        <h1 style="color: green">Tài Khoản Được Tạo</h1>
        <h1 style="color: green">Vui Lòng Kiểm Tra Mail Để Kích Hoạt Tài Khoản</h1>
    </c:if>

    <form name='f' id="validate" action="<c:url value='j_spring_security_check' />"
          method='POST'>

        <table>
            <tr>
                <td>Email:</td>
                <td><input type='text' name='j_username' value='' class="validate[required,custom[email]"></td>
            </tr>
            <tr>
                <td>Password:</td>
                <td><input type='password' name='j_password' class="validate[required,minSize[5]]" /></td>
            </tr>
            <tr>
                <td></td>
                <td>
                    <div class="p-button p-button-red">
                        <input type="submit" class="p-button-start cm-check-user-panel-resize" value="Đăng nhập" name="addUserPage" id="save_profile_but">
                        <div class="p-button-end"></div>
                    </div>
                </td>
            </tr>
        </table>

    </form>
</div>